package org.danng.taobao;

import org.danng.db.DbUtilsTemplate;
import org.danng.domain.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

@Repository
public class UserModel {
	@Autowired
	private DbUtilsTemplate dbUtilsTemplate;

	public void setDbUtilsTemplate(DbUtilsTemplate dbUtilsTemplate) {
		this.dbUtilsTemplate = dbUtilsTemplate;
	}
	public User getUser() {
		User user  = dbUtilsTemplate.findFirst(User.class, "SELECT * FROM goon_user");
		return user;
	}
public static void main(String[] args) {
		UserModel userModel=new UserModel();
		userModel.getUser();
}
}
